<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{{ Admin::title() }}</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="{{ cdn("/packages/admin/AdminLTE/bootstrap/css/bootstrap.min.css") }}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">

    <!-- Theme style -->
    <link rel="stylesheet" href="{{ cdn("/packages/admin/AdminLTE/dist/css/skins/" . config('admin.skin') .".min.css") }}">

    {!! Admin::css() !!}
    <link rel="stylesheet" href="{{ mixcdn('css/winged.css') }}">

    <!-- REQUIRED JS SCRIPTS -->
    <script src="{{ cdn ("/packages/admin/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js") }}"></script>
    <script src="{{ cdn ("/packages/admin/AdminLTE/bootstrap/js/bootstrap.min.js") }}"></script>

    <!--左边树的展开与收起-->
 	<script src="{{ cdn ("/packages/admin/AdminLTE/dist/js/app.min.js") }}"></script>
	<script>
        function LA() {}
        LA.token = "{{ csrf_token() }}";
        LA.permissions = {!! Auth::user()->permissions() !!};
        <?php \Illuminate\Support\Facades\Auth::user()->requireBasicUserInfo();?>
        LA.userInfo = {!! \Illuminate\Support\Facades\Auth::user()->userInfo !!};
        LA.bucket = "{{ config('winged.backend.oss.bucket') }}";
	</script>

</head>

<body class="hold-transition {{config('admin.skin')}} {{join(' ', config('admin.layout'))}}">
<div class="wrapper">

    @include('admin::partials.header')

    @include('admin::partials.sidebar')

    <div class="content-wrapper" id="pjax-container" style="min-height: 880px;">
        @yield('content')
        {!! Admin::script() !!}
    </div>

    @include('admin::partials.footer')

</div>

<style>
    .menuactive a{
        color: #fff;
    }
    .menuactive a{
        background-color: #444!important;
    }
</style>
<script>
    function hight_light_menu(url){
        var protol = window.location.protocol ,
                port = window.location.port === "" ? "" : ":" + window.location.port,
                host = window.location.host ;
        url  = (url || window.location.href).replace(protol + "//" + host + port , ""),
                menu = $('#menubar a'),
                obj = null ,
                setParent = function(element){
                    element = element.parent();
                    if(element.is('ul')){
                        element.addClass("menu-open");
                    }else if(element.is('li')){
                        var menu_waps = $('#menubar li');
                        menu_waps.each(function(index,item){
                            item.className = ''
                        })
                        element.addClass("active");
                    }else{
                        return false;
                    }
                    setParent(element);
                };
        menu.each(function(index ,item){
            if(url.replace(/http:\/\/[^\/]*/,'') == $(item).attr('href')){
                obj = $(item);
            }
        });
        if(obj == null){
            return ;
        }
        // 查找他的parent
        obj.parent().addClass('menuactive');
        setParent(obj);
    }
    hight_light_menu();

    window.addEventListener('hashchange',function(){
        hight_light_menu()
    })

</script>
{!! Admin::js() !!}
</body>
</html>
